import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import('@/views/Main.vue'),
    children:[
      {
        path: 'history',
        name: 'History',
        component: () => import('@/components/History.vue')
      },
      {
        path: 'historyForWorker',
        name: 'HistoryForWorker',
        component: () => import('@/components/HistoryForWorker.vue')
      },
      {
        path: 'historyForCust',
        name: 'HistoryForCust',
        component: () => import('@/components/HistoryForCust.vue')
      },
      {
        path: 'salary',
        name: 'Salary',
        component: () => import('@/components/WorkerSalary.vue')
      },
      {
        path: 'modifyPwd',
        name: 'modifyPwd',
        component: () => import('@/views/ModifyPwd.vue')
      },
      {
        path: 'modifyInfo',
        name: 'modifyInfo',
        component: () => import('@/components/ModifyPersonlnfo.vue')
      },
      {
        path: 'stat',
        name: 'Stat',
        component: () => import('@/components/WaterCountStat.vue')
      },
      {
        path: 'customerOrder',
        name: 'CustomerOrder',
        component: () => import('@/components/CustomerOrder.vue')
      },
      {
        path: "workerOrder",
        name: 'WorkerOrder',
        component: () => import('@/components/WorkerOrder.vue')
      },
      {
        path:'customerModify',
        name:'customerModify',
        component:()=>import('@/components/CustomerModify.vue')
      },
      {
        path:'ticketRemainder',
        name:'ticetRemainder',
        component:()=>import('@/components/TicketRemainder.vue')
      },
      {
        path: 'customer',
        name: 'customer',
        component: () => import('@/components/MyCustomer.vue')
      },
      {
        path: 'worker',
        name: 'worker',
        component: () => import('@/components/Myworker.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
